package com.kly.user.enums;

/**
 * 审核语状态：0-初始化 1-审核成功 2-审核中 3-审核不通过
 * @author linqu
 */
public enum GreetingStatus {

    INIT(0, "Reviewing", "初始化"),
    APPROVED(1, "APPROVED", "审核成功"),
    IN_PROCESSING(2, "Reviewing", "审核中"),
    REJECTED(3, "Audit failed", "审核不通过"),
    ;

    private final int type;

    private final String Value;

    private final String description;


    GreetingStatus(int type, String value, String description) {
        this.type = type;
        Value = value;
        this.description = description;
    }

    public int getType() {
        return type;
    }

    public String getValue() {
        return Value;
    }

    public String getDescription() {
        return description;
    }


    public static GreetingStatus fromType(int type) {
        for (GreetingStatus userStatus : values()) {
            if (userStatus.getType() == type) {
                return userStatus;
            }
        }
        throw new IllegalArgumentException("Invalid login type: " + type);
    }
}
